package com.zsgl.service.impl;

import java.io.Serializable;

import org.springframework.beans.factory.annotation.Autowired;

import com.zsgl.dao.HotelDAO;
import com.zsgl.domain.Hotel;
import com.zsgl.service.HotelService;

public class HotelServiceImpl implements HotelService {

	private HotelDAO hotelDAO;
	
	@Autowired
	public HotelServiceImpl(HotelDAO hotelDAO) {
		this.hotelDAO = hotelDAO;
	}

	public void save(Hotel hotel) {
		hotelDAO.save(hotel);
		hotelDAO.flush();
	}

	public void delete(Serializable id) {
		hotelDAO.delete(hotelDAO.find(id));
		hotelDAO.flush();
	}

	public void update(Hotel hotel) {
		hotelDAO.update(hotel);
		hotelDAO.flush();
	}

	public Hotel find(Serializable id) {
		return hotelDAO.find(id);
	}

}
